const qiniu = require('qiniu');
const qnConfig = require('../config').config.qiniuConfig;
qiniu.conf.ACCESS_KEY = qnConfig.ACCESS_KEY;
qiniu.conf.SECRET_KEY = qnConfig.SECRET_KEY;
const mac = new qiniu.auth.digest.Mac(qnConfig.ACCESS_KEY, qnConfig.SECRET_KEY);
const options = {
    scope: qnConfig.Bucket_Name,
    expires: 7200
};
const putPolicy = new qiniu.rs.PutPolicy(options);
exports.getToken = function(){
    return putPolicy.uploadToken(mac);
}